﻿using System;
using System.Collections.Generic;
using System.Text;

namespace RAP.Framework.Libary.SqlTaskParser
{
  /// <summary>
  /// 解析上下文对象
  /// </summary>
  public class SqlParseContext
  {
    /// <summary>
    /// 当前Token
    /// </summary>
    public SqlToken CurrentToken { get; set; }

    /// <summary>
    /// 当前Token
    /// </summary>
    public SqlToken LastToken { get; set; }

    /// <summary>
    /// 当前需要解析的原始SQL语句
    /// </summary>
    public string Sql { get; set; }

    /// <summary>
    /// 当前并发任务队列
    /// </summary>
    public SqlTaskCollection CurrentParallelTasks { get; set; }

    /// <summary>
    /// 解析结果对象
    /// </summary>
    public SqlParseResult ParseResult { get; } = new SqlParseResult();

    /// <summary>
    /// 默认数据源Id
    /// </summary>
    public string DefaultDataSourceId { get; set; }

    /// <summary>
    /// 最近一个SQL任务
    /// </summary>
    public SqlTask LastTask { get; set; }

    /// <summary>
    /// 当前SQL任务
    /// </summary>
    public SqlTask CurrentTask { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public Func<SqlTask> CreateSqlTask { get; set; }
  }
}
